<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>管理员登录</title>
		<script type="text/javascript" src="vue.js"></script>
		<script type="text/javascript" src="axios.min.js"></script>
		<script type="text/javascript" src="const.js"></script>
	</head>
	<body>
		<div id="app">
			<h1>管理员登录</h1>
			<input v-model="username"/><br/>
			<input v-model="password" type="password"/><br/>
			<button v-on:click="login">登录</button>
		</div>
	</body>
	<script type="text/javascript">
		var config={
			el:"#app",
			data:{
				username:"请输入用户名",
				password:"请输入密码"
			},
			methods:{
				login:function(){
					debugger;
					var serverUrl=serverHost+"/admin/login"+"?adminName="+this.username+"&adminPassword="+this.password;
					axios.get(serverUrl)
					.then(function(response){
						debugger;
						var result=response.data;
						window.alert(result);
						//管理员登录成功后，跳到后台管理页面
						location.href="item.html";
					})
					.catch();
				}
			}
		};
		var vue=new Vue(config);
	</script>
</html>
